<?php
function sp_redis_plugin_redirect(){
	delete_option('sp_redis_url');
	delete_option('sp_redis_command');
	delete_option('sp_redis_request');
	delete_option('sp_redis_request_no');
	delete_option('sp_redis_predis');
	sp_redis_count_int(home_url(),'del');
}
function sp_redis_plugin_activation(){
	add_option('sp_redis_url');
	add_option('sp_redis_command');
	add_option('sp_redis_request');
	add_option('sp_redis_request_no');
	add_option('sp_redis_predis');
	sp_redis_count_int(home_url(),'add');
}
function sp_redis_count_int($url,$command){
	if ($command == 'add'){
		$command = 'domain';
	}else{
		$command = 'del';
	}
	$url = md5($url);
	$curl = curl_init();
	curl_setopt($curl, CURLOPT_URL, 'https://6ns.net/sp-redis-cache?'. $command .'='.$url);
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
	date_default_timezone_get('PRC');
	curl_exec($curl);
	curl_close($curl);
}
?>